package com.sunwayhorizo.health.platform.security.persistent;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.sunwayhorizo.health.platform.util.BeanHelper;

@Entity
@TableGenerator(name = "SecurityDataType_IdGenerator", table = "ET_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn", pkColumnValue = "SECURITY_DATA_TYPE_ID",allocationSize=1)
@Table(name = "SECURITY_DATA_TYPE", schema = "ETS")
public class SecurityDataType implements java.io.Serializable {
	
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "SecurityDataType_IdGenerator")
	@Column(name = "DATA_TYPE_ID", unique = true, nullable = false, length = 32)
	private String dataTypeId;
	
	@Column(name = "DATA_TYPE_NAME", length = 30)
	private String dataTypeName;

	@Column(name = "DATA_TYPE_CODE", length = 20)
	private String dataTypeCode;
	
	@Column(name = "CREATOR_NAME", length = 20)
	private String creatorName;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "CREATE_TIME", length = 7)
	private Date createTime;
	
	@Column(name = "MODIFIER_NAME", length = 20)
	private String modifierName;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "MODIFY_TIME", length = 7)
	private Date modifyTime;
	
	@Column(name = "REMARK", length = 200)
	private String remark;
	
	@Column(name = "REF_ID", length = 32)
	private String refId;
	
	@Column(name = "REF_TYPE", length = 20)
	private String refType;
	
	@OneToMany(mappedBy = "dataType",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
	private List<SecurityResourceDataType> resourceDataTypes = new ArrayList<SecurityResourceDataType>(
			0);
	
	@OneToMany(mappedBy = "dataType",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
	private List<SecurityDataObject> dataObjects = new ArrayList<SecurityDataObject>(
			0);

	public SecurityDataType() {
	}

	public SecurityDataType(String dataTypeId) {
		this.dataTypeId = dataTypeId;
	}

	public SecurityDataType(String dataTypeId, String dataTypeName,
			String dataTypeCode, String creatorName, Date createTime,
			String modifierName, Date modifyTime, String remark, String refId,
			String refType, List<SecurityResourceDataType> resourceDataTypes,
			List<SecurityDataObject> dataObjects) {
		super();
		this.dataTypeId = dataTypeId;
		this.dataTypeName = dataTypeName;
		this.dataTypeCode = dataTypeCode;
		this.creatorName = creatorName;
		this.createTime = createTime;
		this.modifierName = modifierName;
		this.modifyTime = modifyTime;
		this.remark = remark;
		this.refId = refId;
		this.refType = refType;
		this.resourceDataTypes = resourceDataTypes;
		this.dataObjects = dataObjects;
	}

	public String getDataTypeId() {
		return this.dataTypeId;
	}

	public void setDataTypeId(String dataTypeId) {
		this.dataTypeId = dataTypeId;
	}

	public String getDataTypeName() {
		return this.dataTypeName;
	}

	public void setDataTypeName(String dataTypeName) {
		this.dataTypeName = dataTypeName;
	}

	public String getDataTypeCode() {
		return this.dataTypeCode;
	}

	public void setDataTypeCode(String dataTypeCode) {
		this.dataTypeCode = dataTypeCode;
	}

	public String getCreatorName() {
		return this.creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getModifierName() {
		return this.modifierName;
	}

	public void setModifierName(String modifierName) {
		this.modifierName = modifierName;
	}

	public Date getModifyTime() {
		return this.modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getRefId() {
		return refId;
	}

	public void setRefId(String refId) {
		this.refId = refId;
	}

	public String getRefType() {
		return refType;
	}

	public void setRefType(String refType) {
		this.refType = refType;
	}

	public List<SecurityResourceDataType> getResourceDataTypes() {
		return this.resourceDataTypes;
	}

	public void setResourceDataTypes(
			List<SecurityResourceDataType> resourceDataTypes) {
		this.resourceDataTypes = resourceDataTypes;
	}

	public List<SecurityDataObject> getDataObjects() {
		return this.dataObjects;
	}

	public void setDataObjects(
			List<SecurityDataObject> dataObjects) {
		this.dataObjects = dataObjects;
	}

	@Override
	public String toString() {
		return BeanHelper.toString(this);
	}
}
